"""
求解常微分方程的初边值问题
"""
print(__doc__)

import sympy as sp

# initialize the print environment
sp.init_printing()
# symbolize the parameters
x = sp.symbols('x')
y = sp.Function('y')
# set x to be the differential function
ode = sp.Eq(sp.diff(y(x), x, 3) - sp.diff(y(x), x, 2) - x, rhs=0)
# initial conditions
ics = {sp.diff(y(x), x, 1).subs(x, 1): 7, sp.diff(y(x), x, 2).subs(x, 2): 4}
# get the solution with ics
sol = sp.dsolve(ode, ics=ics)
# pretty print
sp.pprint(sol)
